import {Outlet} from "react-router-dom";
import useLoadUserData from "../hooks/useLoadUserData";
import {Spin} from "antd";
import useNavPage from "../hooks/useNavPage";

export function QuestionLayout() {
    const {waitingUserData} = useLoadUserData()
    useNavPage(waitingUserData)
    return (
        <div style={{height: "100vh"}}>
            {waitingUserData ? <div style={{textAlign: 'center', marginTop: 100}}>
                <Spin/>
            </div> : <Outlet></Outlet>}
        </div>
    );
}